package DataImport_Template_16;

public abstract class DataImporter {
    public abstract String readFile(String filePath);
    public abstract String parseData(String data);
    public abstract boolean validateData(String data);
    public abstract void saveData(String data);

    public final void importData(String filePath) {
        String data = readFile(filePath);
        String parsedData = parseData(data);
        boolean isValid = validateData(parsedData);
        if(isValid) {
            System.out.println("数据校验通过");
            saveData(parsedData);
        } else {
            System.out.println("数据校验失败");
        }
    }
}
